# Buscar data, hacer graficos

# # # get ip frec porcen

# load
src <- read.table('vendors.frec', header=T)

# info
graph = "vendors.png"
print(src)

# pie chart
slices <- src$frec
labs <- src$ip
porcen <- round(slices/sum(slices)*100, digits=2)

cant <- paste("[#",slices,sep="") # add cant to labels
cant <- paste(cant,"]",sep="")
labs <- paste(labs, cant)

porcen <- paste("(", porcen, sep="") # add percents to labels 
porcen <- paste(porcen, "%)", sep="") 
labs <- paste(labs, porcen) 

# flush
png(filename=graph, width=800, height=600, bg="white")
pie(slices, labels = labs, col=rainbow(length(labs)),
    main="Paquetes por Vendor sobre sniffing ARP a través de tráfico big_arp provisto por la cátedra")
dev.off()
